<template>
  <div class="app-container">
    <el-card class="search-card">
      <el-row :gutter="10" class="mb8">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="buttonMethods(1)"
          v-hasPermi="['campus:unpaid:export']"
        >
          添加
        </el-button>
        <right-toolbar
          :showSearch.sync="showSearch"
          @queryTable="getList"
        ></right-toolbar>
      </el-row>
    </el-card>
    <el-card class="table-card">
      <el-table :data="dataList">
        <el-table-column label="校区" align="center" prop="name" />
        <el-table-column label="标题" align="center" prop="idCardNumber" />
        <el-table-column label="自动退款" align="center" prop="idCardNumber" />
        <el-table-column
          label="退款执行周期（次月月初退款）"
          align="center"
          prop="idCardNumber"
        />
        <el-table-column label="开启订餐" align="center" prop="idCardNumber" />
        <el-table-column label="创建时间" align="center" prop="idCardNumber" />
        <el-table-column label="创建人" align="center" prop="idCardNumber" />
      </el-table>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </el-card>
    <el-dialog :title="title" :visible.sync="status" width="40%" append-to-body>
      <el-form ref="form" :model="queryForm" label-width="115px">
        <el-row>
          <el-col :span="20">
            <el-form-item label="校区名称" prop="gradeId" style="width: 100%">
              <el-select
                v-model="queryParams.gradeId"
                placeholder="请选择校区名称"
                style="width: 100%"
              >
                <el-option
                  v-for="(item, index) in gradeList"
                  :key="index"
                  :value="item.id"
                  :label="item.gradeName"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="20">
            <el-form-item label="标题" prop="gradeName">
              <el-input
                v-model="queryForm.gradeName"
                placeholder="请输入标题"
                maxlength="50"
                show-word-limit
              />
            </el-form-item>
          </el-col>
          <el-col :span="20">
            <el-form-item label="是否自动退款" prop="gradeName">
              <el-radio-group v-model="queryForm.radio">
                <el-radio :label="1">是</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="20">
            <el-form-item label="退款执行周期" prop="gradeName">
              <el-radio-group v-model="queryForm.radio">
                <el-radio :label="1">系统执行退款时间统一次月月初退款</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="20">
            <el-form-item label="开启订餐" prop="gradeName">    
              <el-radio-group v-model="queryForm.radio">
                <el-radio :label="1">启用</el-radio>
                <el-radio :label="2">停用</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="buttonMethods(2)">确 定</el-button>
        <el-button @click="buttonMethods(3)">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listGrade } from "@/api/campus/grade";
import { listClassManage } from "@/api/campus/classManage";

export default {
  name: "teamMealSet",
  data() {
    return {
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 1,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      status: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      dataList: [
        {
          status: 1,
          name: "1",
        },
        {
          name: "2",
          status: 2,
        },
      ],
      campusList: [],
      gradeList: [],
      queryForm: {},
    };
  },
  created() {},
  activated() {},
  methods: {
    // 列表
    getList() {},
    /**
     * 按钮相关的方法集合
     *
     * @returns {void}
     */
    buttonMethods(options, value) {
      // 添加
      if (options == 1) {
        this.title = "团餐设置";
        this.status = true;
      }
      //关闭
      else if (options == 2) {
      }
      //查看
      else if (options == 3) {
      }
      // 删除
      else if (options == 4) {
      }
      // 取消请假
      else if (options == 5) {
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 导出
    handleExport() {
      this.download(
        "",
        {
          ...this.queryParams,
        },
        `餐别管理导出.xlsx`
      );
    },
  },
};
</script>
<style>
.formBox >>> .el-form-item--small.el-form-item {
  margin-bottom: 0px !important;
}

.formBox >>> .el-form-item__label {
  font-size: 12px !important;
  padding: 0 !important;
}
</style>
